<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<title>JQuery Validation Engine</title>
	<link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css"/>
	<link rel="stylesheet" href="../css/template.css" type="text/css"/>
	<script src="../js/jquery-1.8.2.min.js" type="text/javascript">
	</script>
	<script src="../js/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8">
	</script>
	<script src="../js/jquery.validationEngine.js" type="text/javascript" charset="utf-8">
	</script>
	<script>
		jQuery(document).ready(function(){
			jQuery("#formID").validationEngine();

			$("#formID").bind("jqv.field.result", function(event, field, errorFound, prompText){ console.log(errorFound) })
		});
	</script>
</head>
<body>
	<p>
		<a href="#" onclick="alert(jQuery('#formID').validationEngine({evaluate:true}))">Return true or false without binding anything</a>
		| <a href="#" onclick="jQuery.validationEngine.buildPrompt('#formID','This is an example','error')">Build a prompt on a div</a>
		| <a href="#" onclick="jQuery.validationEngine.loadValidation('#date')">Load validation date</a>
		| <a href="#" onclick="jQuery.validationEngine.closePrompt('.formError',true)">Close all prompt</a>
		| <a href="../index.html" onclick="">Back to index</a>
	</p>    
	<p style="color:red; text-align:center">Please run this demo from a WebServer, it will fail otherwise.
	</p>
	<p>
		This demonstrations shows the use of inline Ajax validations. The inline ajax validation is never fired on submit.
		<br/>
		The form validation implements callback hooks, so please check the javascript console
	</p>
	<form id="formID" class="formular" method="post" action="" style="width:600px">
		<fieldset>
			<legend>
				Ajax validation
			</legend>
			<label>
				<span>Desired username (ajax validation, only <b>karnius</b> is available) : </span>
				<input value="" class="validate[required,custom[onlyLetterNumber],maxSize[20],ajax[ajaxUserCallPhp]] text-input" type="text" name="user" id="user" />
				<p>
					validate[required,custom[noSpecialCaracters],maxSize[20],ajax[ajaxUserCall]]
				</p>
			</label>
			<label>
				<span>First name (ajax validation, only <b>duncan</b> is available): </span>
				<input value="" class="validate[optional,custom[onlyLetterSp],maxSize[100],ajax[ajaxNameCallPhp]] text-input" type="text" name="firstname" id="firstname" />
				<p>
					validate[custom[onlyLetterSp],length[0,100],ajax[ajaxNameCall]]
				</p>
			</label>
			<label>
				<span>Email address : </span>
				<input value="" class="validate[required,custom[email]] text-input" type="text" name="email" id="email" />
				<p>
					validate[required,custom[email]]
				</p>
			</label>
		</fieldset>
		<input class="submit" type="submit" value="Validate &amp; Send the form!"/><hr/>
	</form>
</body>
</html>